---
title: Terraform Enterprise
hide_title: true
---

# Terraform Enterprise

## Terraform Enterprise Integration

Starting from v0.9.5, Weave GitOps tf-controller officially supports integration to **Terraform Cloud (TFC)** and 
**Terraform Enterprise (TFE)**. Here are the steps to set up tf-controller for your TFE instance.

![](./tfe_integration_01.png)

### Terraform Login

First, you need to obtain an API token from your TFE. You can use `terraform login` command to do so.

```shell
terraform login tfe.dev.example.com
```

Then you can find your API token inside `$HOME/.terraform.d/credentials.tfrc.json`.
Content of the file will look like this:

```json
{
  "credentials": {
    "tfe.dev.example.com": {
      "token": "mXXXXXXXXX.atlasv1.ixXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
    }
  }
}
```

### Prepare an TFRC file
TF-controller accepts an TFRC file in the HCL format. So you have to prepare `terraform.tfrc` file using contents from above.
```hcl
credentials "tfe.dev.example.com" {
  token = "mXXXXXXXXX.atlasv1.ixXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX"
}
```